<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>
<style>
    #layui-laydate1,.layui-laydate-main,.layui-laydate-header,.layui-laydate-content,.layui-laydate-content table{width: 100%!important;}
    .layui-laydate-content td{border:none!important;height: 65px!important;}
    .layui-laydate-content td:hover{background-color: #FFFFFF!important;}
    #shuoming{padding: 15px 20px}
    #shuoming div{width: 33%;float: left}
    .laydate-day-mark::after{display: none}
    .laydate-day-mark{top:13px!important;font-size:16px!important;}
    .curss{width: 40px;height: 40px;line-height: 40px;display: inline-block;border-radius: 3px;color: #FFFFFF;}
    .curhong{background-color: #F23030!important;cursor: pointer}
    .curlv{background-color: #4CAF50!important;cursor: pointer}
    .curhuang{background-color: #FEA918!important;cursor: pointer}
    .curzi{background-color: #aa63f7!important;cursor: pointer}
    .curhui{background-color: #bbb!important;cursor: pointer}
    .curbai{background-color: #FFF!important;cursor: pointer;color: #666!important;}
</style>
<body>
<form class="layui-form layui-form-pane" id="operatePage">
    <div class="page-title">
        <div class="page-title-con">
            <span>监理日志填报</span>
            <div class="move_title"></div>
            <div class="page-title-opt-list">
                <span id="page-close" class="page-close" onclick="layer_close()"><i class="layui-icon layui-icon-close"></i></span>
            </div>
        </div>
    </div>

    <div class="main-container">
        <div class="divkuai">
            <div class="layui-inline" id="baodate" style="width: calc(100% - 40px);margin-left: 20px"></div>
            <div id="shuoming">
                <div><i class="layui-icon layui-icon-circle-dot colorhong"></i> 尚未填报，点击日期可填报</div>
                <div><i class="layui-icon layui-icon-circle-dot colorlv"></i> 已填报并通过</div>
                <div><i class="layui-icon layui-icon-circle-dot colorhuang"></i> 已填报待审核</div>
                <div><i class="layui-icon layui-icon-circle-dot colorzi"></i> 已填报被驳回，点击可编辑</div>
                <div><i class="layui-icon layui-icon-circle-dot colorhui"></i> 无需填报</div>
            </div>
        </div>
    </div>
</form>
<script>
    var param_enginid = getQueryVariable('enginid') || 0;

    ajax_get_lan_data();
    function ajax_get_lan_data(date=''){
        layui.use(['laytp', 'form'], function() {
            var form = layui.form, layer = layui.layer;
            render_input_attr();
            facade.ajax({url: ask_engin_jian_lan, data:{enginid: param_enginid,date:date}}).done(function(res){
                if (res.code === 2000) {
                    init_date(res.data.data, res.data.date)
                }
            });
        });
    }




    function init_date(data, date_value) {
        $("#baodate").html('');
        layui.use(['laydate'],function() {
            layui.laydate.render({
                elem: '#baodate'
                ,position: 'static'
                ,btns: []
                , mark:data
                ,value:date_value
                ,change: function(value, date, endDate){
                    var ymd = date.year+'-'+date.month+'-'+date.date;
                    var key = $('#baodate').find('td[lay-ymd='+ymd+']').find(".curss").attr('key');
                    var dataid = $('#baodate').find('td[lay-ymd='+ymd+']').find(".curss").attr('dataid');

                    if(key == undefined){
                        ajax_get_lan_data(value)
                    }
                    if(key == 0){
                        parent.lanpage_0(dataid);
                    }
                    if(key == 1){
                        parent.lanpage_1(dataid);
                    }
                    if(key == 9){
                        parent.lanpage_9(dataid);
                    }
                    if(key == 7){
                        parent.lanpage_7(param_enginid, value);
                    }
                }
            });
        });
    }

</script>
<style>
    .layui-laydate .layui-this{background-color: #FFFFFF!important;color: #666!important;}
</style>
</body>
</html>
